package hust.music.action;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import hust.music.action.base.ActionBase;
import hust.music.entity.User;
import hust.music.service.UserModService;

/**
 * ToFollowFanAction
 * 
 * @author Txazo
 * @since 1.0
 */
@Controller
@Scope("session")
public class ToFollowFanAction extends ActionBase {

	private static final long serialVersionUID = 1L;

	/** 用户Id */
	private int id;
	/** 用户 */
	private User user;

	@Autowired
	private UserModService userModService;

	/**
	 * 跳转到我的关注
	 * 
	 * @return 逻辑视图
	 */
	public String execute() {
		user = userModService.get(id);

		session.put("follow", user);

		System.out.println(user.getId());
		System.out.println(user.getNickname());

		return SUCCESS;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

}
